package wjio;

import java.io.*;

public class demo7_0526 {
    public static void main(String[] args) throws IOException {
//        InputStream inputStream = null;
//        try {
//            inputStream = new FileInputStream("./test.txt");
//        } finally {
//            inputStream.close();
//        }

        try (InputStream inputStream = new FileInputStream("./test.txt")) {
            while (true) {
//                int b = inputStream.read();
//                if (b == -1) {
//                    break;
//                }
//                System.out.printf("%x ", b);
                byte[] b = new byte[1024];
                int n = inputStream.read(b);
                if (n == -1) {
                    break;
                }
                for (int i = 0; i < n; i++) {
                    System.out.printf("%x ",b[i]);
                }
            }
        }


    }
}
